<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>usr_08 - Vim Documentation</title>
<meta name="Generator" content="Vim/8.0">
<meta name="plugin-version" content="vim8.0">
<meta name="syntax" content="help">
<meta name="settings" content="no_pre,use_css,expand_tabs">
<link rel="stylesheet" href="style.css" type="text/css" />

<script src="jquery.min.js" type="text/javascript"></script>
<script src="mark-current-page.js" type="text/javascript"></script>
</head>

<body>

<header>

<div class="header">
  <a href="http://vim-jp.org/">vim-jp</a>
  / <a href="http://vim-jp.org/vimdoc-en/">vimdoc-en</a>
  / usr_08<br />
  <a name="top"></a><h1>usr_08 - Vim Documentation</h1>
  <a href="index.html">Return to main</a>

  <span class="EnglishJapaneseLink">
    <span class="CurrentLanguage">English</span>
  </span>
</div>
</header>

<nav>
<dl>

<dt>BASIC</dt>
<dd><ul>
<li><a href="quickref.html">quickref</a></li>
<li><a href="sponsor.html">sponsor</a></li>
</ul></dd>

<dt>USER MANUAL</dt>
<dd><ul>
<li><a href="usr_toc.html">usr_toc</a></li>
</ul></dd>

<dt>Getting Started</dt>
<dd><ul>
<li><a href="usr_01.html">usr_01</a></li>
<li><a href="usr_02.html">usr_02</a></li>
<li><a href="usr_03.html">usr_03</a></li>
<li><a href="usr_04.html">usr_04</a></li>
<li><a href="usr_05.html">usr_05</a></li>
<li><a href="usr_06.html">usr_06</a></li>
<li><a href="usr_07.html">usr_07</a></li>
<li><a href="usr_08.html">usr_08</a></li>
<li><a href="usr_09.html">usr_09</a></li>
<li><a href="usr_10.html">usr_10</a></li>
<li><a href="usr_11.html">usr_11</a></li>
<li><a href="usr_12.html">usr_12</a></li>
</ul></dd>

<dt>Editing Effectively</dt>
<dd><ul>
<li><a href="usr_20.html">usr_20</a></li>
<li><a href="usr_21.html">usr_21</a></li>
<li><a href="usr_22.html">usr_22</a></li>
<li><a href="usr_23.html">usr_23</a></li>
<li><a href="usr_24.html">usr_24</a></li>
<li><a href="usr_25.html">usr_25</a></li>
<li><a href="usr_26.html">usr_26</a></li>
<li><a href="usr_27.html">usr_27</a></li>
<li><a href="usr_28.html">usr_28</a></li>
<li><a href="usr_29.html">usr_29</a></li>
<li><a href="usr_30.html">usr_30</a></li>
<li><a href="usr_31.html">usr_31</a></li>
<li><a href="usr_32.html">usr_32</a></li>
</ul></dd>

<dt>Tuning Vim</dt>
<dd><ul>
<li><a href="usr_40.html">usr_40</a></li>
<li><a href="usr_41.html">usr_41</a></li>
<li><a href="usr_42.html">usr_42</a></li>
<li><a href="usr_43.html">usr_43</a></li>
<li><a href="usr_44.html">usr_44</a></li>
<li><a href="usr_45.html">usr_45</a></li>
</ul></dd>

<dt>Making Vim Run</dt>
<dd><ul>
<li><a href="usr_90.html">usr_90</a></li>
</ul></dd>

<dt>General subjects</dt>
<dd><ul>
<li><a href="intro.html">intro</a></li>
<li><a href="index.html">help</a></li>
<li><a href="helphelp.html">helphelp</a></li>
<li><a href="vimindex.html">index</a></li>
<li><a href="tags.html">tags</a></li>
<li><a href="howto.html">howto</a></li>
<li><a href="tips.html">tips</a></li>
<li><a href="message.html">message</a></li>
<li><a href="quotes.html">quotes</a></li>
<li><a href="todo.html">todo</a></li>
<li><a href="debug.html">debug</a></li>
<li><a href="develop.html">develop</a></li>
<li><a href="uganda.html">uganda</a></li>
</ul></dd>

<dt>Basic editing</dt>
<dd><ul>
<li><a href="starting.html">starting</a></li>
<li><a href="editing.html">editing</a></li>
<li><a href="motion.html">motion</a></li>
<li><a href="scroll.html">scroll</a></li>
<li><a href="insert.html">insert</a></li>
<li><a href="change.html">change</a></li>
<li><a href="indent.html">indent</a></li>
<li><a href="undo.html">undo</a></li>
<li><a href="repeat.html">repeat</a></li>
<li><a href="visual.html">visual</a></li>
<li><a href="various.html">various</a></li>
<li><a href="recover.html">recover</a></li>
</ul></dd>

<dt>Advanced editing</dt>
<dd><ul>
<li><a href="cmdline.html">cmdline</a></li>
<li><a href="options.html">options</a></li>
<li><a href="pattern.html">pattern</a></li>
<li><a href="map.html">map</a></li>
<li><a href="tagsrch.html">tagsrch</a></li>
<li><a href="quickfix.html">quickfix</a></li>
<li><a href="windows.html">windows</a></li>
<li><a href="tabpage.html">tabpage</a></li>
<li><a href="syntax.html">syntax</a></li>
<li><a href="spell.html">spell</a></li>
<li><a href="diff.html">diff</a></li>
<li><a href="autocmd.html">autocmd</a></li>
<li><a href="filetype.html">filetype</a></li>
<li><a href="eval.html">eval</a></li>
<li><a href="channel.html">channel</a></li>
<li><a href="fold.html">fold</a></li>
</ul></dd>

<dt>Special issues</dt>
<dd><ul>
<li><a href="print.html">print</a></li>
<li><a href="remote.html">remote</a></li>
<li><a href="term.html">term</a></li>
<li><a href="digraph.html">digraph</a></li>
<li><a href="mbyte.html">mbyte</a></li>
<li><a href="mlang.html">mlang</a></li>
<li><a href="arabic.html">arabic</a></li>
<li><a href="farsi.html">farsi</a></li>
<li><a href="hebrew.html">hebrew</a></li>
<li><a href="russian.html">russian</a></li>
<li><a href="ft_ada.html">ft_ada</a></li>
<li><a href="ft_sql.html">ft_sql</a></li>
<li><a href="hangulin.html">hangulin</a></li>
<li><a href="rileft.html">rileft</a></li>
</ul></dd>

<dt>GUI</dt>
<dd><ul>
<li><a href="gui.html">gui</a></li>
<li><a href="gui_w32.html">gui_w32</a></li>
<li><a href="gui_x11.html">gui_x11</a></li>
</ul></dd>

<dt>Interfaces</dt>
<dd><ul>
<li><a href="if_cscop.html">if_cscop</a></li>
<li><a href="if_lua.html">if_lua</a></li>
<li><a href="if_mzsch.html">if_mzsch</a></li>
<li><a href="if_perl.html">if_perl</a></li>
<li><a href="if_pyth.html">if_pyth</a></li>
<li><a href="if_tcl.html">if_tcl</a></li>
<li><a href="if_ole.html">if_ole</a></li>
<li><a href="if_ruby.html">if_ruby</a></li>
<li><a href="debugger.html">debugger</a></li>
<li><a href="workshop.html">workshop</a></li>
<li><a href="netbeans.html">netbeans</a></li>
<li><a href="sign.html">sign</a></li>
</ul></dd>

<dt>Versions</dt>
<dd><ul>
<li><a href="vi_diff.html">vi_diff</a></li>
<li><a href="version4.html">version4</a></li>
<li><a href="version5.html">version5</a></li>
<li><a href="version6.html">version6</a></li>
<li><a href="version7.html">version7</a></li>
<li><a href="version8.html">version8</a></li>
</ul></dd>

<dt>Remarks about specific systems</dt>
<dd><ul>
<li><a href="os_390.html">os_390</a></li>
<li><a href="os_amiga.html">os_amiga</a></li>
<li><a href="os_beos.html">os_beos</a></li>
<li><a href="os_dos.html">os_dos</a></li>
<li><a href="os_mac.html">os_mac</a></li>
<li><a href="os_mint.html">os_mint</a></li>
<li><a href="os_msdos.html">os_msdos</a></li>
<li><a href="os_os2.html">os_os2</a></li>
<li><a href="os_qnx.html">os_qnx</a></li>
<li><a href="os_risc.html">os_risc</a></li>
<li><a href="os_unix.html">os_unix</a></li>
<li><a href="os_vms.html">os_vms</a></li>
<li><a href="os_win32.html">os_win32</a></li>
</ul></dd>

<dt>Standard plugins</dt>
<dd><ul>
<li><a href="pi_getscript.html">pi_getscript</a></li>
<li><a href="pi_gzip.html">pi_gzip</a></li>
<li><a href="pi_logipat.html">pi_logipat</a></li>
<li><a href="pi_netrw.html">pi_netrw</a></li>
<li><a href="pi_paren.html">pi_paren</a></li>
<li><a href="pi_tar.html">pi_tar</a></li>
<li><a href="pi_vimball.html">pi_vimball</a></li>
<li><a href="pi_zip.html">pi_zip</a></li>
</ul></dd>

<dt>Filetype plugins</dt>
<dd><ul>
<li><a href="pi_spec.html">pi_spec</a></li>
</ul></dd>

<dt>Others</dt>
<dd><ul>
<li><a href="vim_faq.html">vim_faq</a></li>
</ul></dd>

</dl>
</nav>

<article class="Vimdoc VimdocJa">
<div id='vimCodeElement'>
<a class="Constant" href="usr_08.html" name="usr_08.txt">usr_08.txt</a>&nbsp;&nbsp;&nbsp;&nbsp;For&nbsp;<span class="Identifier">Vim version 8.0.</span>&nbsp;&nbsp;Last change: 2014 Jul 06<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VIM USER MANUAL - by Bram Moolenaar<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Splitting windows<br>
<br>
<br>
Display two different files above each other.&nbsp;&nbsp;Or view two locations in the<br>
file at the same time.&nbsp;&nbsp;See the difference between two files by putting them<br>
side by side.&nbsp;&nbsp;All this is possible with split windows.<br>
<br>
<a class="Identifier" href="usr_08.html#08.1">08.1</a>&nbsp;&nbsp;Split a window<br>
<a class="Identifier" href="usr_08.html#08.2">08.2</a>&nbsp;&nbsp;Split a window on another file<br>
<a class="Identifier" href="usr_08.html#08.3">08.3</a>&nbsp;&nbsp;Window size<br>
<a class="Identifier" href="usr_08.html#08.4">08.4</a>&nbsp;&nbsp;Vertical splits<br>
<a class="Identifier" href="usr_08.html#08.5">08.5</a>&nbsp;&nbsp;Moving windows<br>
<a class="Identifier" href="usr_08.html#08.6">08.6</a>&nbsp;&nbsp;Commands for all windows<br>
<a class="Identifier" href="usr_08.html#08.7">08.7</a>&nbsp;&nbsp;Viewing differences with vimdiff<br>
<a class="Identifier" href="usr_08.html#08.8">08.8</a>&nbsp;&nbsp;Various<br>
<a class="Identifier" href="usr_08.html#08.9">08.9</a>&nbsp;&nbsp;Tab pages<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp; Next chapter:&nbsp;<a class="Identifier" href="usr_09.html">usr_09.txt</a>&nbsp;&nbsp;Using the GUI<br>
&nbsp;Previous chapter:&nbsp;<a class="Identifier" href="usr_07.html">usr_07.txt</a>&nbsp;&nbsp;Editing more than one file<br>
Table of contents:&nbsp;<a class="Identifier" href="usr_toc.html">usr_toc.txt</a><br>
<br>
<span class="PreProc">==============================================================================</span><br>
<a class="Constant" href="usr_08.html#08.1" name="08.1">08.1</a>&nbsp;&nbsp;Split a window<br>
<br>
The easiest way to open a new window is to use the following command:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:split</div>
<br>
This command splits the screen into two windows and leaves the cursor in the<br>
top one:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+----------------------------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|/* file one.c */&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|one.c=============================|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|/* file one.c */&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|one.c=============================|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+----------------------------------+<br>
<br>
What you see here is two windows on the same file.&nbsp;&nbsp;The line with &quot;====&quot; is<br>
that status line.&nbsp;&nbsp;It displays information about the window above it.&nbsp;&nbsp;(In<br>
practice the status line will be in reverse video.)<br>
&nbsp;&nbsp; The two windows allow you to view two parts of the same file.&nbsp;&nbsp;For example,<br>
you could make the top window show the variable declarations of a program, and<br>
the bottom one the code that uses these variables.<br>
<br>
The&nbsp;<span class="Special">CTRL-W</span>&nbsp;w command can be used to jump between the windows.&nbsp;&nbsp;If you are in<br>
the top window,&nbsp;<span class="Special">CTRL-W</span>&nbsp;w jumps to the window below it.&nbsp;&nbsp;If you are in the<br>
bottom window it will jump to the first window.&nbsp;&nbsp;(<span class="Special">CTRL-W</span>&nbsp;<span class="Special">CTRL-W</span>&nbsp;does the same<br>
thing, in case you let go of the CTRL key a bit later.)<br>
<br>
<br>
CLOSE THE WINDOW<br>
<br>
To close a window, use the command:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:close</div>
<br>
Actually, any command that quits editing a file works, like &quot;:quit&quot; and &quot;ZZ&quot;.<br>
But &quot;:close&quot; prevents you from accidentally exiting Vim when you close the<br>
last window.<br>
<br>
<br>
CLOSING ALL OTHER WINDOWS<br>
<br>
If you have opened a whole bunch of windows, but now want to concentrate on<br>
one of them, this command will be useful:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:only</div>
<br>
This closes all windows, except for the current one.&nbsp;&nbsp;If any of the other<br>
windows has changes, you will get an error message and that window won't be<br>
closed.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
<a class="Constant" href="usr_08.html#08.2" name="08.2">08.2</a>&nbsp;&nbsp;Split a window on another file<br>
<br>
The following command opens a second window and starts editing the given file:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:split two.c</div>
<br>
If you were editing one.c, then the result looks like this:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+----------------------------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|/* file two.c */&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&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nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+----------------------------------+<br>
<br>
To open a window on a new, empty file, use this:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:new</div>
<br>
You can repeat the &quot;:split&quot; and &quot;:new&quot; commands to create as many windows as<br>
you like.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
<a class="Constant" href="usr_08.html#08.3" name="08.3">08.3</a>&nbsp;&nbsp;Window size<br>
<br>
The &quot;:split&quot; command can take a number argument.&nbsp;&nbsp;If specified, this will be<br>
the height of the new window.&nbsp;&nbsp;For example, the following opens a new window<br>
three lines high and starts editing the file alpha.c:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:3split alpha.c</div>
<br>
For existing windows you can change the size in several ways.&nbsp;&nbsp;When you have a<br>
working mouse, it is easy: Move the mouse pointer to the status line that<br>
separates two windows, and drag it up or down.<br>
<br>
To increase the size of a window:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CTRL-W +</div>
<br>
To decrease it:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CTRL-W -</div>
<br>
Both of these commands take a count and increase or decrease the window size<br>
by that many lines.&nbsp;&nbsp;Thus &quot;4&nbsp;<span class="Special">CTRL-W</span>&nbsp;+&quot; make the window four lines higher.<br>
<br>
To set the window height to a specified number of lines:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{height}CTRL-W _</div>
<br>
That's: a number&nbsp;<span class="Special">{height}</span>,&nbsp;<span class="Special">CTRL-W</span>&nbsp;and then an underscore (the - key with Shift<br>
on English-US keyboards).<br>
&nbsp;&nbsp; To make a window as high as it can be, use the&nbsp;<span class="Special">CTRL-W</span>&nbsp;_ command without a<br>
count.<br>
<br>
<br>
USING THE MOUSE<br>
<br>
In Vim you can do many things very quickly from the keyboard.&nbsp;&nbsp;Unfortunately,<br>
the window resizing commands require quite a bit of typing.&nbsp;&nbsp;In this case,<br>
using the mouse is faster.&nbsp;&nbsp;Position the mouse pointer on a status line.&nbsp;&nbsp;Now<br>
press the left mouse button and drag.&nbsp;&nbsp;The status line will move, thus making<br>
the window on one side higher and the other smaller.<br>
<br>
<br>
OPTIONS<br>
<br>
The&nbsp;<a class="Type" href="options.html#'winheight'">'winheight'</a>&nbsp;option can be set to a minimal desired height of a window and<br>
<a class="Type" href="options.html#'winminheight'">'winminheight'</a>&nbsp;to a hard minimum height.<br>
&nbsp;&nbsp; Likewise, there is&nbsp;<a class="Type" href="options.html#'winwidth'">'winwidth'</a>&nbsp;for the minimal desired width and<br>
<a class="Type" href="options.html#'winminwidth'">'winminwidth'</a>&nbsp;for the hard minimum width.<br>
&nbsp;&nbsp; The&nbsp;<a class="Type" href="options.html#'equalalways'">'equalalways'</a>&nbsp;option, when set, makes Vim equalize the windows sizes<br>
when a window is closed or opened.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
<a class="Constant" href="usr_08.html#08.4" name="08.4">08.4</a>&nbsp;&nbsp;Vertical splits<br>
<br>
The &quot;:split&quot; command creates the new window above the current one.&nbsp;&nbsp;To make<br>
the window appear at the left side, use:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:vsplit</div>
<br>
or:<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:vsplit two.c</div>
<br>
The result looks something like this:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+--------------------------------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|/* file two.c */&nbsp;&nbsp; |/* file one.c */&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|two.c===============one.c=============|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+--------------------------------------+<br>
<br>
Actually, the | lines in the middle will be in reverse video.&nbsp;&nbsp;This is called<br>
the vertical separator.&nbsp;&nbsp;It separates the two windows left and right of it.<br>
<br>
There is also the &quot;:vnew&quot; command, to open a vertically split window on a new,<br>
empty file.&nbsp;&nbsp;Another way to do this:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:vertical new</div>
<br>
The &quot;:vertical&quot; command can be inserted before another command that splits a<br>
window.&nbsp;&nbsp;This will cause that command to split the window vertically instead<br>
of horizontally.&nbsp;&nbsp;(If the command doesn't split a window, it works<br>
unmodified.)<br>
<br>
<br>
MOVING BETWEEN WINDOWS<br>
<br>
Since you can split windows horizontally and vertically as much as you like,<br>
you can create almost any layout of windows.&nbsp;&nbsp;Then you can use these commands<br>
to move between them:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">CTRL-W</span>&nbsp;h&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move to the window on the left<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">CTRL-W</span>&nbsp;j&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move to the window below<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">CTRL-W</span>&nbsp;k&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move to the window above<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">CTRL-W</span>&nbsp;l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move to the window on the right<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">CTRL-W</span>&nbsp;t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move to the TOP window<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">CTRL-W</span>&nbsp;b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move to the BOTTOM window<br>
<br>
You will notice the same letters as used for moving the cursor.&nbsp;&nbsp;And the<br>
cursor keys can also be used, if you like.<br>
&nbsp;&nbsp; More commands to move to other windows:&nbsp;<a class="Identifier" href="quickref.html#Q_wi">Q_wi</a>.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
<a class="Constant" href="usr_08.html#08.5" name="08.5">08.5</a>&nbsp;&nbsp;Moving windows<br>
<br>
You have split a few windows, but now they are in the wrong place.&nbsp;&nbsp;Then you<br>
need a command to move the window somewhere else.&nbsp;&nbsp;For example, you have three<br>
windows like this:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+----------------------------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+----------------------------------+<br>
<br>
Clearly the last one should be at the top.&nbsp;&nbsp;Go to that window (using&nbsp;<span class="Special">CTRL-W</span>&nbsp;w)<br>
and the type this command:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CTRL-W K</div>
<br>
This uses the uppercase letter K.&nbsp;&nbsp;What happens is that the window is moved to<br>
the very top.&nbsp;&nbsp;You will notice that K is again used for moving upwards.<br>
&nbsp;&nbsp; When you have vertical splits,&nbsp;<span class="Special">CTRL-W</span>&nbsp;K will move the current window to the<br>
top and make it occupy the full width of the Vim window.&nbsp;&nbsp;If this is your<br>
layout:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+-------------------------------------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|/* two.c */&nbsp;&nbsp;|/* three.c */&nbsp;&nbsp;|/* one.c */&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|~&nbsp;&nbsp;&nbsp;&nbsp;&n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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|two.c=========three.c=========one.c========|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+-------------------------------------------+<br>
<br>
Then using&nbsp;<span class="Special">CTRL-W</span>&nbsp;K in the middle window (three.c) will result in:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+-------------------------------------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|/* three.c */&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+-------------------------------------------+<br>
<br>
The other three similar commands (you can probably guess these now):<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">CTRL-W</span>&nbsp;H&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move window to the far left<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">CTRL-W</span>&nbsp;J&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move window to the bottom<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Special">CTRL-W</span>&nbsp;L&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move window to the far right<br>
<br>
<span class="PreProc">==============================================================================</span><br>
<a class="Constant" href="usr_08.html#08.6" name="08.6">08.6</a>&nbsp;&nbsp;Commands for all windows<br>
<br>
When you have several windows open and you want to quit Vim, you can close<br>
each window separately.&nbsp;&nbsp;A quicker way is using this command:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:qall</div>
<br>
This stands for &quot;quit all&quot;.&nbsp;&nbsp;If any of the windows contain changes, Vim will<br>
not exit.&nbsp;&nbsp;The cursor will automatically be positioned in a window with<br>
changes.&nbsp;&nbsp;You can then either use &quot;:write&quot; to save the changes, or &quot;:quit!&quot; to<br>
throw them away.<br>
<br>
If you know there are windows with changes, and you want to save all these<br>
changes, use this command:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:wall</div>
<br>
This stands for &quot;write all&quot;.&nbsp;&nbsp;But actually, it only writes files with<br>
changes.&nbsp;&nbsp;Vim knows it doesn't make sense to write files that were not<br>
changed.<br>
&nbsp;&nbsp; And then there is the combination of &quot;:qall&quot; and &quot;:wall&quot;: the &quot;write and<br>
quit all&quot; command:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:wqall</div>
<br>
This writes all modified files and quits Vim.<br>
&nbsp;&nbsp; Finally, there is a command that quits Vim and throws away all changes:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:qall!</div>
<br>
Be careful, there is no way to undo this command!<br>
<br>
<br>
OPENING A WINDOW FOR ALL ARGUMENTS<br>
<br>
To make Vim open a window for each file, start it with the &quot;-o&quot; argument:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vim -o one.txt two.txt three.txt</div>
<br>
This results in:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+-------------------------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|file one.txt&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|three.txt======================|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+-------------------------------+<br>
<br>
The &quot;-O&quot; argument is used to get vertically split windows.<br>
&nbsp;&nbsp; When Vim is already running, the &quot;:all&quot; command opens a window for each<br>
file in the argument list.&nbsp;&nbsp;&quot;:vertical all&quot; does it with vertical splits.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
<a class="Constant" href="usr_08.html#08.7" name="08.7">08.7</a>&nbsp;&nbsp;Viewing differences with vimdiff<br>
<br>
There is a special way to start Vim, which shows the differences between two<br>
files.&nbsp;&nbsp;Let's take a file &quot;main.c&quot; and insert a few characters in one line.<br>
Write this file with the&nbsp;<a class="Type" href="options.html#'backup'">'backup'</a>&nbsp;option set, so that the backup file<br>
&quot;main.c~&quot; will contain the previous version of the file.<br>
&nbsp;&nbsp; Type this command in a shell (not in Vim):<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vimdiff main.c~ main.c</div>
<br>
Vim will start, with two windows side by side.&nbsp;&nbsp;You will only see the line<br>
in which you added characters, and a few lines above and below it.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|main.c~==============main.c==============|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+-----------------------------------------+<br>
<br>
(This picture doesn't show the highlighting, use the vimdiff command for a<br>
better look.)<br>
<br>
The lines that were not modified have been collapsed into one line.&nbsp;&nbsp;This is<br>
called a closed fold.&nbsp;&nbsp;They are indicated in the picture with &quot;&lt;- fold&quot;.&nbsp;&nbsp;Thus<br>
the single fold line at the top stands for 123 text lines.&nbsp;&nbsp;These lines are<br>
equal in both files.<br>
&nbsp;&nbsp; The line marked with &quot;&lt;- changed line&quot; is highlighted, and the inserted<br>
text is displayed with another color.&nbsp;&nbsp;This clearly shows what the difference<br>
is between the two files.<br>
&nbsp;&nbsp; The line that was deleted is displayed with &quot;---&quot; in the main.c window.<br>
See the &quot;&lt;- deleted line&quot; marker in the picture.&nbsp;&nbsp;These characters are not<br>
really there.&nbsp;&nbsp;They just fill up main.c, so that it displays the same number<br>
of lines as the other window.<br>
<br>
<br>
THE FOLD COLUMN<br>
<br>
Each window has a column on the left with a slightly different background.&nbsp;&nbsp;In<br>
the picture above these are indicated with &quot;VV&quot;.&nbsp;&nbsp;You notice there is a plus<br>
character there, in front of each closed fold.&nbsp;&nbsp;Move the mouse pointer to that<br>
plus and click the left button.&nbsp;&nbsp;The fold will open, and you can see the text<br>
that it contains.<br>
&nbsp;&nbsp; The fold column contains a minus sign for an open fold.&nbsp;&nbsp;If you click on<br>
this -, the fold will close.<br>
&nbsp;&nbsp; Obviously, this only works when you have a working mouse.&nbsp;&nbsp;You can also use<br>
&quot;zo&quot; to open a fold and &quot;zc&quot; to close it.<br>
<br>
<br>
DIFFING IN VIM<br>
<br>
Another way to start in diff mode can be done from inside Vim.&nbsp;&nbsp;Edit the<br>
&quot;main.c&quot; file, then make a split and show the differences:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:edit main.c<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:vertical diffsplit main.c~&nbsp;</div>
<br>
The &quot;:vertical&quot; command is used to make the window split vertically.&nbsp;&nbsp;If you<br>
omit this, you will get a horizontal split.<br>
<br>
If you have a patch or diff file, you can use the third way to start diff<br>
mode.&nbsp;&nbsp;First edit the file to which the patch applies.&nbsp;&nbsp;Then tell Vim the name<br>
of the patch file:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:edit main.c<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:vertical diffpatch main.c.diff</div>
<br>
WARNING: The patch file must contain only one patch, for the file you are<br>
editing.&nbsp;&nbsp;Otherwise you will get a lot of error messages, and some files might<br>
be patched unexpectedly.<br>
&nbsp;&nbsp; The patching will only be done to the copy of the file in Vim.&nbsp;&nbsp;The file on<br>
your harddisk will remain unmodified (until you decide to write the file).<br>
<br>
<br>
SCROLL BINDING<br>
<br>
When the files have more changes, you can scroll in the usual way.&nbsp;&nbsp;Vim will<br>
try to keep both the windows start at the same position, so you can easily see<br>
the differences side by side.<br>
&nbsp;&nbsp; When you don't want this for a moment, use this command:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:set noscrollbind</div>
<br>
<br>
JUMPING TO CHANGES<br>
<br>
When you have disabled folding in some way, it may be difficult to find the<br>
changes.&nbsp;&nbsp;Use this command to jump forward to the next change:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]c</div>
<br>
To go the other way use:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[c</div>
<br>
Prepended a count to jump further away.<br>
<br>
<br>
REMOVING CHANGES<br>
<br>
You can move text from one window to the other.&nbsp;&nbsp;This either removes<br>
differences or adds new ones.&nbsp;&nbsp;Vim doesn't keep the highlighting updated in<br>
all situations.&nbsp;&nbsp;To update it use this command:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:diffupdate</div>
<br>
To remove a difference, you can move the text in a highlighted block from one<br>
window to another.&nbsp;&nbsp;Take the &quot;main.c&quot; and &quot;main.c~&quot; example above.&nbsp;&nbsp;Move the<br>
cursor to the left window, on the line that was deleted in the other window.<br>
Now type this command:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dp</div>
<br>
The change will be removed by putting the text of the current window in the<br>
other window.&nbsp;&nbsp;&quot;dp&quot; stands for &quot;diff put&quot;.<br>
&nbsp;&nbsp; You can also do it the other way around.&nbsp;&nbsp;Move the cursor to the right<br>
window, to the line where &quot;changed&quot; was inserted.&nbsp;&nbsp;Now type this command:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;do</div>
<br>
The change will now be removed by getting the text from the other window.<br>
Since there are no changes left now, Vim puts all text in a closed fold.<br>
&quot;do&quot; stands for &quot;diff obtain&quot;.&nbsp;&nbsp;&quot;dg&quot; would have been better, but that already<br>
has a different meaning (&quot;dgg&quot; deletes from the cursor until the first line).<br>
<br>
For details about diff mode, see&nbsp;<a class="Identifier" href="diff.html#vimdiff">vimdiff</a>.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
<a class="Constant" href="usr_08.html#08.8" name="08.8">08.8</a>&nbsp;&nbsp;Various<br>
<br>
The&nbsp;<a class="Type" href="options.html#'laststatus'">'laststatus'</a>&nbsp;option can be used to specify when the last window has a<br>
statusline:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; never<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; only when there are split windows (the default)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; always<br>
<br>
Many commands that edit another file have a variant that splits the window.<br>
For Command-line commands this is done by prepending an &quot;s&quot;.&nbsp;&nbsp;For example:<br>
&quot;:tag&quot; jumps to a tag, &quot;:stag&quot; splits the window and jumps to a<br>
tag.<br>
&nbsp;&nbsp; For Normal mode commands a&nbsp;<span class="Special">CTRL-W</span>&nbsp;is prepended.&nbsp;&nbsp;<span class="Special">CTRL-^</span>&nbsp;jumps to the<br>
alternate file,&nbsp;<span class="Special">CTRL-W</span>&nbsp;<span class="Special">CTRL-^</span>&nbsp;splits the window and edits the alternate file.<br>
<br>
The&nbsp;<a class="Type" href="options.html#'splitbelow'">'splitbelow'</a>&nbsp;option can be set to make a new window appear below the<br>
current window.&nbsp;&nbsp;The&nbsp;<a class="Type" href="options.html#'splitright'">'splitright'</a>&nbsp;option can be set to make a vertically split<br>
window appear right of the current window.<br>
<br>
When splitting a window you can prepend a modifier command to tell where the<br>
window is to appear:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:leftabove&nbsp;<span class="Special">{cmd}</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;left or above the current window<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:aboveleft&nbsp;<span class="Special">{cmd}</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;idem<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:rightbelow&nbsp;<span class="Special">{cmd}</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; right or below the current window<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:belowright&nbsp;<span class="Special">{cmd}</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; idem<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:topleft&nbsp;<span class="Special">{cmd}</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at the top or left of the Vim window<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:botright&nbsp;<span class="Special">{cmd}</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at the bottom or right of the Vim window<br>
<br>
<br>
<span class="PreProc">==============================================================================</span><br>
<a class="Constant" href="usr_08.html#08.9" name="08.9">08.9</a>&nbsp;&nbsp;Tab pages<br>
<br>
You will have noticed that windows never overlap.&nbsp;&nbsp;That means you quickly run<br>
out of screen space.&nbsp;&nbsp;The solution for this is called Tab pages.<br>
<br>
Assume you are editing &quot;thisfile&quot;.&nbsp;&nbsp;To create a new tab page use this command:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:tabedit thatfile</div>
<br>
This will edit the file &quot;thatfile&quot; in a window that occupies the whole Vim<br>
window.&nbsp;&nbsp;And you will notice a bar at the top with the two file names:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+----------------------------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| thisfile | /thatfile/ __________X|&nbsp;&nbsp;&nbsp;&nbsp;(thatfile is bold)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|/* thatfile */&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|that&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|that&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+----------------------------------+<br>
<br>
You now have two tab pages.&nbsp;&nbsp;The first one has a window for &quot;thisfile&quot; and the<br>
second one a window for &quot;thatfile&quot;.&nbsp;&nbsp;It's like two pages that are on top of<br>
each other, with a tab sticking out of each page showing the file name.<br>
<br>
Now use the mouse to click on &quot;thisfile&quot; in the top line.&nbsp;&nbsp;The result is<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+----------------------------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| /thisfile/ | thatfile __________X|&nbsp;&nbsp;&nbsp;&nbsp;(thisfile is bold)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|/* thisfile */&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|this&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|this&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+----------------------------------+<br>
<br>
Thus you can switch between tab pages by clicking on the label in the top<br>
line.&nbsp;&nbsp;If you don't have a mouse or don't want to use it, you can use the &quot;gt&quot;<br>
command.&nbsp;&nbsp;Mnemonic: Goto Tab.<br>
<br>
Now let's create another tab page with the command:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:tab split</div>
<br>
This makes a new tab page with one window that is editing the same buffer as<br>
the window we were in:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+-------------------------------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| thisfile | /thisfile/ | thatfile __X|&nbsp;&nbsp; (thisfile is bold)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|/* thisfile */&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|this&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|this&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbs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p;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+-------------------------------------+<br>
<br>
You can put &quot;:tab&quot; before any Ex command that opens a window.&nbsp;&nbsp;The window will<br>
be opened in a new tab page.&nbsp;&nbsp;Another example:<br>
<br>
<div class="helpExample">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:tab help gt</div>
<br>
Will show the help text for &quot;gt&quot; in a new tab page.<br>
<br>
A few more things you can do with tab pages:<br>
<br>
- click with the mouse in the space after the last label<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The next tab page will be selected, like with &quot;gt&quot;.<br>
<br>
- click with the mouse on the &quot;X&quot; in the top right corner<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The current tab page will be closed.&nbsp;&nbsp;Unless there are unsaved<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;changes in the current tab page.<br>
<br>
- double click with the mouse in the top line<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A new tab page will be created.<br>
<br>
- the &quot;tabonly&quot; command<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Closes all tab pages except the current one.&nbsp;&nbsp;Unless there are unsaved<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;changes in other tab pages.<br>
<br>
For more information about tab pages see&nbsp;<a class="Identifier" href="tabpage.html#tab-page">tab-page</a>.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
<br>
Next chapter:&nbsp;<a class="Identifier" href="usr_09.html">usr_09.txt</a>&nbsp;&nbsp;Using the GUI<br>
<br>
Copyright: see&nbsp;<a class="Identifier" href="usr_01.html#manual-copyright">manual-copyright</a>&nbsp;&nbsp;vim:tw=78:ts=8:ft=help:norl:<br>
</div>

</article>

<footer>
<a href="#top">Return to the top</a> - <a href="index.html">Return to main</a>
<span class="EnglishJapaneseLink">
  <span class="CurrentLanguage">English</span>
</span>
<br />
<div style="text-align:right;">
Hosted by <a href="https://github.com/vim-jp/vimdoc-en">vimdoc-en project</a><br />
If you met any problem, please report it to <a href="https://github.com/vim-jp/vimdoc-en/issues">issue</a>.<br />
</div>
</footer>

<!--<script src="js/check-referrer.js" type="text/javascript"></script>-->

</body>
</html>
<!-- vim:set ts=8 sts=2 sw=2 tw=0 et: -->
